package com.apes.fn.business.fixedLoss.modle;

import com.apes.framework.jpa.BaseModel;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.scm.masterdata.product.model.Product;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * @ClassName : LossAssessmentGoods
 * @Description : 定损专用商品
 * @Author : WSJ
 * @Date: 2020-06-09 15:59
 */
@Setter
@Getter
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = LossAssessmentGoods.CONST_TABLE_NAME)
@SelectBeforeUpdate
@DynamicUpdate
@DynamicInsert
public class LossAssessmentGoods extends BaseModel {
    public static final String CONST_TABLE_NAME = "loss_assessment_goods";

    @Id
    @Column(name = "id", nullable = false, length = 24)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "定损报价单", padding = 10,prefix = "1")
    @Comment("定损报价单号")
    private String id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "product", referencedColumnName = "id")
    @Comment("商品")
    private Product product;

    @Column(name = "tax_Rate")
    @Comment("税率")
    private String taxRate;

    @Column(name = "use_Type")
    @Comment("使用类型(1:自费,2:以修代换)")
    private String useType;


 }
